/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.co.prosofi.managedBean;

import com.co.prosofi.entidades.Persona;
import com.co.prosofi.session.PersonaFacade;
import com.co.prosofi.session.PersonaFacadeLocal;
import java.io.Serializable;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Animal
 */
@ManagedBean
@SessionScoped
public class loginMBean implements Serializable{
    
    @EJB 
    PersonaFacadeLocal login;
    private Persona persona;

    public Persona getPersona() {
        return persona;
    }

    public void setPersona(Persona persona) {
        this.persona = persona;
    }

    /** Creates a new instance of loginMBean */
    public loginMBean() {
        persona = new Persona();
    }
    
    public String crear(){
        try{
            login.create(persona);
            return "welcome.alx";
        }catch(Exception e){
            System.out.println("No se pudo crear el usuario");
        }
        return null;
    }
   
    
}
